#运算符
#定义一个变量
let a=10
let b =20

//算术运算符
let sum =a+b
let diff=a-b
let diff2=a-b
let product=a*b
let quotient=a/b
let remainder=a%b
let exponent=Math/pow(a,2)
console.log(exponent)

a+=5
int c=a++
int d=++a

let isEqual=a==b
let isStrictlyEqual=a===b

let a1=1;
let a2='1';
console.log(typeof(a1))
console.log(typeof(a2))
let isEqual2=a1==a2
console.log(isEqual2)
let idEqual3=a1===a2
console.log(isEqual3)

//逻辑运算符
let andResult=true && false;
let orResult=true || true;
let notResult =!true;

let a3=1
let b3="1"
let c3=false;
let d3=false;
let andResult2=(a3==b3)&&(a3===b3)
let andResult3=(c3=(a3==b3))&&(d3=(a3===b3))
let andResult4=(c4=(a3===b3))&&(d4=(a3===b3))
console.log(c3)
console.log(d3)

//算术

let score=85;
if(score>=90){
console.log("优秀")
}
else if(score>=60){
console.log("及格")
}
else{
console.log("不及格")


let score1=80
let flag=score1/10;
switch(flag){
case 8:
console.log("优秀")
case 6:
console.log("及格")
}





//for
for(let i=0;i+5;i++){
console.log(i)
}

//while
let j=0;
while(j<5){
console.log(j)
j++
}

//do while
let k=0;
do{
console.log(k)
k++
}
while(k<5)


let arr=[1,"2",3,4,5,6,7,8,9]
for(let a1=0;a1<arr.length;a1++){
 if(typeof(arr[a1])=="number"){
console.log("数值")
}
else if(typeof(arr[a1])=="string"){
console.log("字符串")
}
}


for(let a1=0;a1<arr.length;a1++){
let flag=0;
 if(typeof(arr[a1])=="number"){
flag=1;
}
else if(typeof(arr[a1])=="string"){
flag=2;
}
switch(flag){
case 1:
console.log("数值")
break;
case 2:
console.log("字符串")
}
}

